<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <th:block th:replace="headfoot/head::head_common"></th:block>

</head>
<body>
<div class="container-fluid kj-list-container">
    <div class="kj-list-content-container card">
        <form id="queryForm" class="form-horizontal kj-list-queryFrom">

            <div class="kj-list-queryFrom-container">
                <div class="kj-list-queryFrom-item">
                    <div class="form-group col-sm-12">

                        <label class="col-sm-1 control-label kj-list-query-label" title="姓名">姓名</label>
                        <div class="col-sm-2">
                            <input type="text" class="form-control input-sm input-sm" name="name" placeholder="姓名"/>
                        </div>

                        <label class="col-sm-1 control-label kj-list-query-label" title="学号">学号</label>
                        <div class="col-sm-2">
                            <input type="text" class="form-control input-sm" name="number" placeholder="学号"/>
                        </div>

                        <!--院系-->
                        <label class="col-sm-1 control-label kj-list-query-label" title="院系">院系</label>
                        <div class="col-sm-2">
                            <select class="form-control input-sm" id="faculty" name="faculty" th:data-value="${entity?.faculty}"
                                    vic:dict="faculty"
                                    data-linkage="true"
                                    data-linkage-url="/system/dict/byParentValue?parentTypeCode=major"
                                    data-linkage-target="#major"
                                    data-option="--请选择--">

                            </select>
                        </div>
                        <!--专业-->
                        <label class="col-sm-1 control-label kj-list-query-label" title="专业">专业</label>
                        <div class="col-sm-2">
                            <select class="form-control input-sm" id="major" name="major" data-value="">
                                <option value="">--请选择--</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group col-sm-12">
                        <!--班级-->
                        <label class="col-sm-1 control-label kj-list-query-label" title="班级">班级</label>
                        <div class="col-sm-2">
                            <select class="form-control input-sm" id="classesId" name="classesId" data-value="">
                                <option value="">--请选择--</option>
                                <option th:each="cls:${classes}" th:value="${cls.code}">[[${cls.text}]]</option>
                            </select>
                        </div>
                        <!--状态-->
                        <label class="col-sm-1 control-label kj-list-query-label" title="状态">状态</label>
                        <div class="col-sm-2">
                            <select class="form-control input-sm" id="status" name="status" data-value="">
                                <option value="">--请选择--</option>
                                <option value="0">未入学</option>
                                <option value="1">就读中</option>
                                <option value="2">已毕业</option>
                            </select>
                        </div>


                        <div class="col-sm-3  col-sm-offset-3 kj-list-query-btn-container">
                            <button  type="button" class="btn btn-sm btn-default kj-btn-query query"  >
                                <i class="iconfont icon-chaxun"></i> 查询
                            </button>
                            <button type="button" class="btn btn-sm btn-default kj-btn-reset reset">
                                <i class="iconfont icon-zhongzhi"></i>重置
                            </button>
                        </div>
                    </div>
                </div>

            </div>

    <!-- 收起展开按钮 -->
    <div class="kj-packUpdiv"
    ><span class="kj-packUp-span"
    ><i
            id="kj_slideBtn"
            class="kj-packUpdiv-icon kj-icon-shou-by-listpage"
            onclick="common.slideSearchDiv();"
    ></i
    ></span
    ></div>

    <div
            id="kj_list_content_btn_container"
            class="kj-list-content-btn-container form-group col-sm-12">
        <button
                type="button"
                class="btn btn-sm btn-default add-multitab kj-btn-add"
                data-id="add-user-form"
                data-url="/student/student/form"
                data-title="新增学生"
        >
            <i class="iconfont icon-tianjia"></i>&ensp;添加
        </button>

        <button
                class="btn btn-sm btn-default kj-btn-del bootable-action-post"
                type="button"
                data-table="#table"
                data-href="/student/student/batchDelete"
                data-confirm="确认删除吗"
        >
            <i class="iconfont icon-shanchu"></i>&ensp;删除
        </button>
    </div>
    </form>

    <table
            id="table"
            class="table table-bordered table-hover table-striped bootstrapTable kj-list-container-only-table"
            data-list-url="/student/student/list"
            data-form-url="/student/student/form"
            data-del-url="/student/student/delete"
            data-toolbar="#queryForm"
            data-height="1200"
    >
        <thead>
        <tr>
            <th data-checkbox="true"></th>
            <th data-field="name" data-sortable="false">学生名</th>
            <th data-field="number" data-sortable="false">学号</th>
            <th data-field="year" data-sortable="true">入学年份</th>
            <th data-field="facultyName" data-sortable="true" data-sort-name="faculty">院系</th>
            <th data-field="majorName" data-sortable="true" data-sort-name="major">专业</th>
            <th data-field="classesName" data-sortable="true" data-sort-name="classesId">班级</th>
            <th data-field="statusDesc" data-sortable="true" data-sort-name="status">状态</th>
            <th data-field="createTime" data-sortable="true">创建时间</th>
            <th data-field="operate" data-formatter="defaultOperate"
                data-events="defaultOperateEvent">操作
            </th>
        </tr>
        </thead>
    </table>
</div>
</div>

<th:block th:replace="headfoot/foot::list_foot"></th:block>

<script>
    function showStatus(value, row, index, field) {
        var text = value === 1 ? "开课中" : "已关闭";
        var labelClass = $nojs.randomLabel.getRandomLableClass(value + 1);
        return '<span class="' + labelClass + '">' + text + '</span>';
    }

</script>

</body>
</html>